package com.itheima.service.impl;

import com.itheima.domain.User;
import com.itheima.dao.UserDao;
import com.itheima.service.UserService;
import com.itheima.utils.MybatisUtils;
import org.apache.ibatis.session.SqlSession;

public class UserImpl implements UserService {

    @Override
    public User login(String username, String password) {
        SqlSession sqlSession = MybatisUtils.getSqlSession();
        UserDao map = sqlSession.getMapper(UserDao.class);
        User login = map.login(username, password);
        sqlSession.close();
        return login;
    }
}
